package com.imcrl.event{
	
	import com.imcrl.component.drager.AbstractDragger;
	
	import starling.events.Event;
	import starling.events.TouchEvent;
	
	
	/**
	 *  用于拖曳中的事件;
	 * @author crl
	 * 
	 */	
	public class DragAndDropEvent extends Event{
		
		/**
		 * 确认用户想拖; 
		 */		
		public static const DRAG_RECOGNIZED:String = "dragRecognized";	
		
		/**
		 * 开始拖动;  
		 */		
		public static const DRAG_START:String = "dragStart";	
		
		/**
		 * 拖入感应区域 
		 */		
		public static const DRAG_ENTER:String = "dragEnter";	
		
		/**
		 * 拖入感应区域 后在上面的移动都会触发此事件; 
		 */		
		public static const DRAG_OVERRING:String = "dragOverring";	
		
		/**
		 * 拖出感应区域 
		 */		
		public static const DRAG_EXIT:String = "dragExit";	
		
		/**
		 * 放入感应区域  
		 */		
		public static const DRAG_DROP:String = "dragDrop";		
		
		/**
		 * 拖动的对像; 
		 */		
		private var _dragInitiator:AbstractDragger;
		
		/**
		 * 放入触发者; 
		 */		
		private var _dropTrigger:AbstractDragger;
		
		/**
		 * 拖动物品所带的数据; 
		 */		
		private var _sourceData:*;
		
		private var _touchEvent:TouchEvent;
		
		/**
		 * 
		 * @param type
		 * @param dragInitiator
		 * @param sourceData
		 * @param ctrlKey
		 * @param altKey
		 * @param shiftKey
		 * 
		 */		
		public function DragAndDropEvent(type:String, 
								  dragInitiator:AbstractDragger, dropTrigger:AbstractDragger,sourceData:*,touchEvent:TouchEvent){
			super(type);
			
			_dropTrigger=dropTrigger;
			_dragInitiator = dragInitiator;
			_sourceData = sourceData;
			
			_touchEvent=touchEvent;
		}
		
		
		/**
		 * 取得被拖动原始组件; 
		 * @return 
		 * 
		 */		
		public function get dragInitiator():AbstractDragger{
			return _dragInitiator;
		}
		
		public function get touchEvent():TouchEvent{
			return _touchEvent;
		}
		
		/**
		 * 取得放下位置 
		 * @return 
		 * 
		 */		
		public function get dropTrigger():AbstractDragger{
			return _dropTrigger;
		}
		
		/**
		 * 拖动的数据对像代理; 
		 * @return 
		 * 
		 */		
		public function get sourceData():*{
			return _sourceData;
		}
	}
}